package com.sduept.nwld.mobile.manager.wave;

import com.sduept.cim.model.extend.CfgAnalogChannel;
import com.sduept.cim.model.extend.CfgDigitalChannel;
import com.sduept.cim.model.extend.protection.cfg.ProtectCfgAnalogChannel;
import com.sduept.cim.model.extend.protection.cfg.ProtectCfgDigitalChannel;
import com.sduept.core.dao.SuperDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class WaveChannelManager {
	@Autowired
	private SuperDAO dao;
	
	public List<CfgAnalogChannel> listChannelsByConditions(String stationId,String equipmentId,String type,String waveId){
		return dao.findByCondition(CfgAnalogChannel.class, "subId=? and equipmentId=? and type=? and waveId=?",stationId,equipmentId,type,waveId);
    }
	public List<CfgDigitalChannel> listCfgDigitalChannelsByEquipementId(String equipmentId){
		return dao.findByCondition(CfgDigitalChannel.class, "equipmentId =?", equipmentId);
	}
	public List<CfgDigitalChannel> listDiChannelsByConditions(String stationId,String equipmentId,String waveId){
		return dao.findByCondition(CfgDigitalChannel.class, "subId=? and equipmentId=? and waveId=? ",stationId,equipmentId,waveId);
	}
	/**
	 * 根据保护ptId 查找保护的模拟通道
	 * @param ptId
	 * @return
	 */
	public List<ProtectCfgAnalogChannel> listProtectCfgAnalogChannelsByPtId(String ptId){
		return dao.findByCondition(ProtectCfgAnalogChannel.class, "ptId=?", ptId);
	}
	/**
	 * 根据保护ptId 查找对应的数字通道
	 * @param ptId
	 * @return
	 */
	public List<ProtectCfgDigitalChannel> listProtectCfgDigitalChannelsByPtId(String ptId){
		return dao.findByCondition(ProtectCfgDigitalChannel.class, "ptId=?", ptId);
	}
}
